//导入请求工具类
import request from '@/utils/request.js'

//注册
export const registerService = (registerData) => {
    return request.post('/user/register', JSON.stringify(registerData), {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

//登录
export const loginService = (registerData) => {
    return request.post('/user/login', JSON.stringify(registerData), {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}
//获取个人信息
export const userInfoGetService = ()=>{
    return request.get('/user/info');
}
//修改个人信息
export const userInfoEditService = (infoData) => {
    return request.put('/user/editInfo', infoData)
}

//获取管理员首页的展示信息
export const userAdminInfoGetService = () => {
    return request.get('/user/getAllInfo')
}

//获取管理员首页的折线图
export const getOrdersSumService = () => {
    return request.get('/t-order/getAllOrders')
}
